Skip to content

document StreamLimitReachedError when attempting to open streams #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

marten-seemann
Copy link
Member

As of quic-go/quic-go#5060, this is not a net.Error anymore.

@marten-seemann marten-seemann requested a review from Copilot June 24, 2025 16:13
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the documentation to reflect that OpenStream now returns a StreamLimitReachedError instead of a net.Error and adjusts the example error check accordingly.

  • Update prose to mention quic.StreamLimitReachedError rather than a net.Error timeout
  • Update example code to use errors.Is against quic.StreamLimitReachedError
Comments suppressed due to low confidence (2)

content/docs/quic/streams.md:49

  • [nitpick] The phrase 'quic.StreamLimitReachedError error' is redundant; consider writing 'returns a *quic.StreamLimitReachedError' or simply 'returns StreamLimitReachedError'.
`OpenStream` attempts to open a new bidirectional stream (`quic.Stream`), and it never blocks. If it's currently not possible to open a new stream, it returns a `quic.StreamLimitReachedError` error:

content/docs/quic/streams.md:53

  • Using errors.Is with a newly instantiated pointer won't match the returned error instance. Consider using errors.As to match the error type, for example:
var e *quic.StreamLimitReachedError
if errors.As(err, &e) {
    // handle stream limit reached
}
if errors.Is(err, &quic.StreamLimitReachedError{}) {

@marten-seemann marten-seemann merged commit 21ffadf into master Jun 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant